serve (someone) a lesson

Translations
donner une leçon à quelqu'un
Definitions
To teach someone a lesson, often by allowing them to experience the negative consequences of their actions so that they learn not to repeat the same mistake.